package demo09;

/**
 * @author hy
 * @date 2025-03-10
 **/
public class test extends Thread{
    int sum = 0;
    int sum1 = 0;
    int sum2 = 0;
    int sum3 = 0;
    @Override
    public void run() {
        for (int i = 1; i < 101; i++) {
            sum1 += i;
        }
        for (int i = 101; i < 901; i++) {
            sum2 += i;
        }
        for (int i = 901; i < 1001; i++) {
            sum3 += i;
        }
        sum = sum1 + sum2 + sum3;
        System.out.println("sum是："+ sum);
    }
}
